package controllers

import (
	"github.com/astaxie/beego"
	//"fmt"
	"beego/testApp/common/tool"
	"beego/testApp/common/user"


	
)

type AddUserController struct {
	beego.Controller
}

func (c *AddUserController) Get() {

	//fmt.Println("fdsfdsfsdfsdf");
	tool.Pic("enter adduser controller ","add user")

	 username := c.GetString("username")
	 pass     := c.GetString("pass")

	 if(username!="" && pass!=""){
		 user.Adduser(username,pass)
		 c.Redirect("/admin/userlist",301) 
	 }

	  c.TplName = "adduser.html"
}
